package cn.jiyun.order.controller;

import cn.jiyun.order.common.R;
import cn.jiyun.order.pojo.dto.OrderDto;
import cn.jiyun.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;
    @RequestMapping("/findAll")
    public R findAll(@RequestParam(defaultValue = "1")Integer page,@RequestParam(defaultValue = "5")Integer pageSize){
        return orderService.findAll(page,pageSize);
    }
    @RequestMapping("/exportExcel")
    public R exportExcel(HttpServletResponse response){
       orderService.exportExcel(response);
       return R.success("导出成功");
    }

}
